package com.clpms.utils;

import com.clpms.bean.enumBean.ErrorCodeEnum;
import lombok.Data;

/**
 * @author caixinyong
 * @date 2023/3/30 8:40 PM
 */

@Data
public class CommonException extends RuntimeException {

	private Integer code;
	private String msg;
	private Object data;

	public CommonException(ErrorCodeEnum errorCode) {
		this.code = errorCode.getCode();
		this.msg = errorCode.getMsg();
	}

	public CommonException(ErrorCodeEnum errorCode, Object data) {
		this.code = errorCode.getCode();
		this.msg = errorCode.getMsg();
		this.data = data;
	}

	public CommonException(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}
}
